.#{$devui-prefix}-submenu-menu-item-vertical-wrapper {
  overflow: hidden;
}
.#{$devui-prefix}-submenu-menu-item {
  color: $devui-menu-item;
}
.#{$devui-prefix}-menu-vertical {
  padding: 0;
  transition: width $devui-animation-duration-slow $devui-animation-ease-in-smooth,
    padding $devui-animation-duration-slow $devui-animation-ease-in-smooth;
  border-right: $devui-line 1px solid;

  ::after {
    transition: all $devui-animation-duration-fast $devui-animation-ease-in-smooth;
    background: transparent;
  }

  .layer_1 {
    margin: 0 !important;
  }

  .layer_2 {
    // 第一级子菜单
    & > div.#{$devui-prefix}-submenu-title {
      margin: 0 !important;
      background: $devui-block;
    }
  }

  &.#{$devui-prefix}-menu-collapsed {
    .#{$devui-prefix}-menu-icon {
      margin: auto;
    }

    & ul li {
      display: none !important;
    }

    .#{$devui-prefix}-submenu {
      div.#{$devui-prefix}-submenu-title {
        .#{$devui-prefix}-menu-icon {
          margin: auto;
        }
      }
    }
  }

  .#{$devui-prefix}-menu-item-vertical-wrapper {
    padding-left: 0 !important;
    margin: 4px 0 !important;
  }

  .#{$devui-prefix}-menu-item {
    width: 100%;
    height: 40px;
    flex-grow: 1;
    line-height: 40px;
    cursor: pointer;
    color: $devui-menu-item;
    background: $devui-block;
    display: flex;
    transition: background-color $devui-animation-duration-fast $devui-animation-ease-in-out-smooth;

    &:hover {
      color: $devui-list-item-hover-text;
      background-color: $devui-list-item-hover-bg;
    }

    span:nth-child(2) {
      // flex: auto;
      text-align: left;
    }
  }

  div:not(.#{$devui-prefix}-submenu-menu-item-vertical-wrapper) {
    display: flex;
    flex: auto;
  }

  .#{$devui-prefix}-menu-item::after {
    display: block;
    position: absolute;
    right: 0;
    top: 0;
    transform: scaleX(0);
    content: '';
    opacity: 1;
    background: $devui-menu-item-selectBar;
  }
  // sub menu
  ul.#{$devui-prefix}-submenu {
    margin: 0;
    padding: 0;
    .#{$devui-prefix}-menu-item {
      display: flex;

      & > span {
        flex: auto;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        transition: all $devui-animation-duration-fast $devui-animation-ease-in-smooth;
        color: $devui-menu-item;
      }
    }
    div.#{$devui-prefix}-submenu-title {
      display: flex;
      cursor: pointer;
      width: 100%;
      height: 40px;
      line-height: 40px;
      padding-left: 18px;
      align-items: center;
      color: $devui-menu-item;
      transition: background-color $devui-animation-duration-fast $devui-animation-ease-in-out-smooth;

      &:hover {
        color: $devui-list-item-hover-text;
        background-color: $devui-list-item-hover-bg;
      }

      &:nth-child(1) {
        font-size: $devui-font-size-lg;
      }

      span.#{$devui-prefix}-submenu-title-content {
        font-size: $devui-font-size-lg;
        flex: auto;
        color: $devui-menu-item;
      }

      span.#{$devui-prefix}-menu-icon {
        text-align: center;
      }

      .icon-chevron-up {
        transition: transform $devui-animation-duration-slow $devui-animation-ease-in-out-smooth;
      }

      i.icon-chevron-up.is-opened {
        transform: rotate(180deg);
      }
    }
    .#{$devui-prefix}-submenu-title:hover {
      span {
        color: $devui-menu-item-hover !important;
      }
    }

    .#{$devui-prefix}-menu-item:hover {
      span {
        color: $devui-menu-item-select;
      }
    }

    .#{$devui-prefix}-menu-item-select {
      * {
        color: $devui-menu-item-select !important;
      }
    }
  }

  .#{$devui-prefix}-menu-item-select {
    background: $devui-primary-bg !important;
    position: relative;

    span,
    a {
      color: $devui-menu-item-select;
    }

    &::after {
      display: block;
      position: absolute;
      right: 0;
      top: 0;
      height: 100%;
      width: 4px;
      content: '';
      opacity: 1;
      background: var(--devui-brand, #5e7ce0);
      transform: scaleX(1);
    }
  }

  .#{$devui-prefix}-menu-item:hover {
    color: $devui-menu-item-select;
  }

  li.#{$devui-prefix}-menu-item,
  div.#{$devui-prefix}-submenu-title {
    white-space: nowrap;
    overflow: hidden;

    span:nth-child(2) {
      overflow: hidden;
      text-overflow: ellipsis;

      span {
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
  }

  .#{$devui-prefix}-menu-item-isCollapsed {
    width: fit-content;

    .#{$devui-prefix}-menu-icon {
      margin: auto;
    }
  }

  ul li ~ ul > div {
    margin-top: 0 !important;
  }
  .#{$devui-prefix}-menu-item-disabled,
  .#{$devui-prefix}-submenu-disabled {
    * {
      color: $devui-menu-item-disabled !important;
      cursor: not-allowed !important;
      background: $devui-block !important;
    }
  }
  .#{$devui-prefix}-menu-item-disabled::after,
  .#{$devui-prefix}-submenu-disabled::after {
    content: unset;
  }

  .#{$devui-prefix}-menu__arrow-icon {
    width: 16px;
    height: 16px;
    transition: transform $devui-animation-duration-slow $devui-animation-ease-in-out-smooth;

    path {
      fill: $devui-text-weak;
    }

    &.is-opened {
      transform: rotate(180deg);
    }
  }
}
